Skip to content

feat(id-import-notion): row notes, property claims, relations (#13523 remainder) - #14358

Merged
developing-today-fleet[bot] merged 1 commit into
mainfrom
lane/23183-notion-remainder
Nov 24, 2026
Merged

developing-today-fleet[bot] merged 1 commit into
mainfrom
lane/23183-notion-remainder

Conversation

@developing-today-fleet

@developing-today-fleet developing-today-fleet Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

What landed

The #13523 remainder after PR #14026 (database-note identity + schema claims), per design #6436 §2.2/§3:

  • New rows module — convert_row turns an inventoried row page into its §2.2 form: note identity, a typed reference to the database note, and property values recorded as claims interpreted against the schema of the data source the row was read from. A value whose type disagrees with its own source's schema, or that names a property the schema does not carry, fails closed (the conflation guard).
  • Relations as typed references whose type is the schema identity (data source, property) — never the parent database. Dual relations use the canonical unordered pair joined via dual_property.synced_property_id, stored sorted so both sides import as the one type. Values resolve only against rows of the schema's target data source; anything else is an externalised relation with its reason (outside_import_set / not_target_source_row), counted, never dropped.
  • Rollups/formulas as derived-value provenance claims (display value + verbatim definition); system properties as provenance claims; button/verification named in the not-imported accounting instead of imported as values.
  • Manifest gains row_records (serde-defaulted; older manifests still load), keyed by page UUID, replaced wholesale on re-conversion.
  • content: child_database references now resolve their target note ID from the database identity pass (fail closed when an inventoried database has no assigned note ID).

Tests

cargo test -p id-import-notion (laptop, nix develop in pkgs/id — this repo's CI runs on main only): 37 passed, 0 failed. New coverage: 8 unit tests in rows (fail-closed validation, dual-relation canonical type shared by both sides, externalisation, claim forms, re-run idempotence) and a recorded-fixture test over the multi-source fixture database covering §8 check 8's second half and the check-2 relation subset. Clippy warnings on the crate are all pre-existing; none are in the new code.

Remainder (issue stays open)

§6.1 moved-source claim supersession is not in this PR: it belongs to the re-import driver — schema claims are conversion artifacts, not manifest state, today, so there is no claim-history surface to supersede into yet. Recorded on #13523; queue task 23183 is released with that resume record.

Refs #13523

{
  "direct_parent": null,
  "links": [],
  "lineage": {
    "design": null,
    "roadmap_item": null,
    "priority": null
  },
  "pm_meta": 1,
  "provenance": {
    "queue_id": null,
    "scheduled_start": null,
    "picked_up_at": null,
    "work_started_at": null,
    "created_at": "2026-11-24T13:26:27Z",
    "session_id": null,
    "lane": null,
    "host": "htch-runtime",
    "worktree": null,
    "model": null,
    "lane_start_issues": [],
    "workspace_ref": null,
    "auth_subject": "archer",
    "stamped_by": "fleet 0.1.0 (native)"
  }
}

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

…remainder)

Implements the #13523 remainder after PR #14026 (database-note
identity + per-data-source schema claims):

- New `rows` module: `convert_row` turns an inventoried row page
  into its design-§2.2 form — note identity, a typed reference to
  the database note, and property values recorded as claims
  interpreted against the schema of the data source the row was
  read from. A value whose type disagrees with its own source's
  schema, or that names a property the schema does not carry,
  fails the conversion closed (the §2.2 conflation guard).
- Relations become typed references between row notes whose type
  is the relation's schema identity (data source, property) —
  never the parent database. One-way relations use their single
  pair; dual relations use the canonical unordered pair joined
  via `dual_property.synced_property_id`, stored sorted so both
  sides import as the one type. Values resolve only against rows
  of the schema's target data source; anything else is recorded
  as an externalised relation with its reason
  (outside-import-set / not-target-source-row) and counted.
- Rollups and formulas become derived-value provenance claims
  (computed display value plus the verbatim definition, never
  silently-authoritative values); system properties (unique ID,
  created/last-edited time and by) become provenance claims;
  button/verification properties are named in the not-imported
  accounting instead of being imported as values.
- Records persist in the manifest (`row_records`, serde-defaulted
  so older manifests still load), keyed by the row's page UUID and
  replaced wholesale on re-conversion, so an unchanged corpus
  reproduces identical artifacts.
- content: `child_database` references now resolve their target
  note ID from the database identity pass, failing closed when an
  inventoried database has no assigned note ID; a database outside
  the import set keeps `None`.
- Tests: 8 unit tests in `rows` plus a recorded-fixture test over
  the multi-source fixture database covering design §8 check 8's
  second half (every row's claims validate against its own
  source's schema and the colliding Status claim against no other;
  the relation defined in only one source produces references for
  rows of that source only) and the check-2 relation subset (each
  relation value is a typed reference or externalised with the
  expected reason). Full crate suite: 37 passed, 0 failed
  (`cargo test -p id-import-notion`, laptop `nix develop` in
  pkgs/id; this repo's CI runs on main only).

Refs #13523. Remaining on the issue: §6.1 moved-source claim
supersession, which belongs to the re-import driver — schema
claims are conversion artifacts, not manifest state, today.
@coderabbitai

coderabbitai Bot commented Nov 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4e873bf1-6060-4ede-81b4-bd5d8751f4ed

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant